﻿using System;
using System.Collections.Generic;

public class Order
{
    public int OrderId { get; set; }
    public string CustomerName { get; set; }
    public DateTime OrderDate { get; set; }
    public List<OrderDetail> Details { get; set; } = new List<OrderDetail>();

    public decimal TotalAmount
    {
        get
        {
            decimal total = 0;
            foreach (var detail in Details)
            {
                total += detail.Ammount;
            }
            return total;
        }
    }

    public override string ToString()
    {
        return $"Order ID: {OrderId}, Customer: {CustomerName}, Date: {OrderDate}, Total: {TotalAmount:C}";
    }
}
